package me.zhengjie.modules.loan.service;

import me.zhengjie.base.PageInfo;
import me.zhengjie.base.CommonService;
import me.zhengjie.modules.loan.domain.Loan;
import me.zhengjie.modules.loan.service.dto.LoanDto;
import me.zhengjie.modules.loan.service.dto.LoanQueryParam;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Set;

/**
* @author lida
* @date 2022-04-28
*/
public interface LoanService extends CommonService<Loan>  {

    static final String CACHE_KEY = "loan";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<LoanDto>
    */
    PageInfo<LoanDto> queryAll(LoanQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<LoanDto>
    */
    List<LoanDto> queryAll(LoanQueryParam query);

    Loan getById(String id);
    LoanDto findById(String id);

    /**
     * 插入一条新数据。
     */
    int insert(LoanDto resources);
    int updateById(LoanDto resources);
    int removeById(String id);
    int removeByIds(Set<String> ids);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
     //void download(List<LoanDto> all, HttpServletResponse response) throws IOException;
}
